home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Arsenal Files 6
/
The Arsenal Files 6 (Arsenal Computer).ISO
/
prg_casm
/
jlvesa11.zip
/
JLVESA04.ASM
< prev
next >
Wrap
Assembly Source File
|
1995-11-14
|
2KB
|
88 lines
; This routine is part of the VESA SVGA -library
;
; Copyright 1994 Johannes Lehtinen
; All rights reserved
model large,c
p386
include "jlvesads.asm"
extrn vesa_repos_w:far
segment jlvesa04_TEXT USE16 'CODE'
assume cs:jlvesa04_TEXT
; void JVPixel_Draw(JVSWord x, JVSWord y, JVUByte color)
proc JVPixel_Draw far
public JVPixel_Draw
push bp
mov bp,sp
push ds
push es
push di
mov ax,JLVesa_Data
mov ds,ax
; Check that pixel is on the screen
mov ax,[ss:bp+6] ; Check x-coordinate
cmp ax,0
jl short outside
cmp [ds:Width],ax
jle short outside
mov ax,[ss:bp+8] ; Check y-coordinate
cmp ax,0
jl short outside
cmp [ds:Height],ax
jle short outside
; Calculate the absolute address of pixel
xor eax,eax ; Calculate the address of line
mov ax,[ss:bp+8]
xor ebx,ebx
mov bx,[ds:LWidth]
mul ebx
mov bx,[ss:bp+6] ; Calculate the address of pixel
add eax,ebx
add eax,[ds:AStart] ; Add start address of active page
mov edx,eax
; Check if window has to be repositioned
cmp [ds:WAStart],edx
jbe short check2
call far vesa_repos_w
check2:
mov ecx,edx
sub ecx,[ds:WAStart]
cmp [ds:WSize],ecx
ja short draw_pixel
call far vesa_repos_w
; Draw pixel to screen
draw_pixel:
sub edx,[ds:WAStart]
mov di,dx
mov ax,[ds:WWSeg]
mov es,ax
mov al,[ss:bp+10]
stosb
outside:
pop di
pop es
pop ds
pop bp
retf
endp
ends
end